#define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

#include<stdio.h>
#include<math.h>
#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
using namespace std;

int main()
{
	char s[1005];
	cin >> s;
	int l = strlen(s);
	double xx = 0, sum = 0, abs = 0;
	int t = 1, f = 1;
	char x;
	for (int i = 0; i < l; i++)
	{
		if (s[i] >= '0' && s[i] <= '9')
		{
			sum = sum * 10 + s[i] - '0';
		}
		else
		{
			if (s[i] >= 'a' && s[i] <= 'z' || s[i] >= 'A' && s[i] <= 'Z')
			{
				x = s[i];
				xx += f * sum * t;
			}
			else
			{
				abs += -1 * f * sum * t;
				if (s[i] == '-')
					t = -1;
				else
					t = 1;
				if (s[i] == '=')
					f = -1;
			}
			sum = 0;
		}
	}
	if (s[l - 1] != x)
		abs += -1 * sum * t * f;

	printf("%c=%.3lf\n", x, abs / xx);
	return 0;
}
